const mockJS = require('mockjs')

const info = mockJS.mock({
  'name': '@cname',
  'age|10-20': 1,
  'addr': mockJS.Random.province(),
});

const list = mockJS.mock({
  'data|100': [{
    'name': '@name',
    'age|10-20': 1,
    'addr': mockJS.Random.province(),
  }]
}).data;

module.exports = [
  {
    method: 'get',
    url: '/api/info',
    response: () => {
      return {
        code: 200,
        msg: 'success',
        data: info
      };
    }
  },
  {
    method: 'get',
    url: '/api/list',
    response: () => {
      return {
        code: 200,
        msg: 'success',
        data: list
      };
    }
  }
];